<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%@ include file="./common/common.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>订单细节</title>
          <meta http-equiv="pragma" content="no-cache">
          <meta http-equiv="cache-control" content="no-cache">
          <meta  http-equiv="pics-label" content="no-cache">
          <meta http-equiv="expires" content="0">
          <script type="text/javascript" src="js/jquery.js"language="javascript"></script>
          <script src='<%=basePath%>dwr/interface/reviewServices.js'></script>
          <script src="<%=basePath%>dwr/engine.js"></script>
          <script src="<%=basePath%>dwr/util.js"></script>
    
           <script type="text/javascript" language="javascript">
             function Preview(ipt){
               var value = $.trim(ipt.value);
               if(value=="")return;
               reviewServices.getOrderItems(value,callBackFunction);
               ipt.value="";
             }
             
             function remove(idx){
               //alert(idx);
               $("#input"+idx).remove();
               $("#tr"+idx).remove();
             }
             
             function callBackFunction(data){
               var date = new Date();
               var now=date.getYear()+"-"+(date.getMonth()+1)+"-"+date.getDate();
               for(var property in data){ 
               var i="sku"+data[property].cmtpdtorderid;
               
               $("#orderReview").append("<input id='input"+i+"' type='hidden' name='skus' value='"+data[property].cmtpdtorderid+"'/>");
               $("#reviewTable").append("<tr id='tr"+i+"'><td>"+data[property].orderid+"</td><td>"+data[property].cmtpdtid+"</td><td>"+data[property].cmtpdtorderid+"</td><td>"+data[property].attribute+"</td><td>"+data[property].ordernum+"</td><td>"+data[property].arrivedate+"</td><td>"+now+"</td><td>正常发货</td><td><input type='button' value='移除' onclick=remove('"+i+"') /></td></tr>");
               //$("#reviewTable").append("<td>"+data[property].orderid+"</td>");
               //$("#reviewTable").append("<td>"+data[property].cmtpdtid+"</td>");
               //$("#reviewTable").append("<td>"+data[property].cmtpdtorderid+"</td>");
               //$("#reviewTable").append("<td>"+data[property].attribute+"</td>");
               //$("#reviewTable").append("<td>"+data[property].ordernum+"</td>");
               //$("#reviewTable").append("<td>"+now+"</td>");
               //$("#reviewTable").append("<td>"+now+"</td><td>"+data[property].arrivedate+"</td><td>正常发货</td></tr>");
               //$("#reviewTable").append("<td>正常发货</td>");
               //$("#reviewTable").append("</tr>");
               }
             }
           </script>
  </head>
  <body>
          <div class="float div">
          <h3>发货单导出:</h3>
          <hr>
            SKU码:<input type="text" name="" onkeyup="Preview(this);"/>
          <hr>
          <h3>发货单预览</h3>
          <form action="orderOutPut.jsp" method="post" >
          <input name="skus" type="hidden" value="first">
           <table id="reviewTable" border="1" width="100%" bordercolor='#000000'>
             <tr>							
               <th>采购单号</th>
               <th>条码</th>
               <th>SKU</th>
               <th>产品属性</th>
               <th>数量</th>
               <th>到货日期</th>
               <th>发货日期</th>
               <th>采购备注</th>
               <th>移除</th>
             </tr>
           </table>
          <div id="orderReview">
           
          </div>
          
          <input type="submit" value="导出" />
          </form>
          </div>
          <br />
   </body>
</html>
